<template>
  <div id="get_record">
    <c-title :hide="false" :text="'领取记录'"> </c-title>
    <diyBackGround></diyBackGround>
    <div class="statusBox"></div>
    <template v-if="!noneShow">
      <template v-for="(item, index) in record_list.data">
        <div class="timeSelect" :key="index">
          <div class="timeBox" @click="show = false">
            <div class="time">{{ index }}</div>
            <!-- <van-icon name="arrow-down" size="12px" /> -->
          </div>
          <div class="totalNum">{{integral?integral:'积分'}}：{{ money_arr[index] ? money_arr[index].income : "0.00" }}</div>
        </div>
        <div class="list" :key="index">
          <div class="lis" v-for="(info, index) in item" :key="index" >
            <div class="lisTop">
              <div class="txtName">{{ info.name }}</div>
              <div class="price">{{ info.point }}</div>
            </div>
            <div class="lisTop dob">
              <div class="time">{{ info.created_at }}</div>
              <div class="balance" v-if="info.validity_at" >有效期：{{ info.validity_at }}</div>
            </div>
          </div>
        </div>
      </template>
    </template>
    <template v-else>
      <div class="timeSelect" :key="index">
        <div class="timeBox" @click="show = false">
          <div class="time">{{ postDate }}</div>
          <van-icon name="arrow-down" size="12px" />
        </div>
        <div class="totalNum">支出：￥0.00 收入：￥0.00</div>
      </div>
      <div class="list">
        <div class="listTxt">暂无记录</div>
      </div>
    </template>

    <van-popup v-model="show" position="bottom" :style="{ height: '40%' }">
      <van-datetime-picker @confirm="pickConfirm" v-model="currentDate" type="year-month" title="选择年月" :max-date="maxDate" :formatter="formatter" />
    </van-popup>

    <div id="content" v-if="false">
      <ul class="list" v-for="(list, i) in dataList" :key="i">
        <li>
          <span>{{ list.name }}</span>
          <span>+{{ list.point }}</span>
        </li>
        <li>
          <span>{{ list.created_at }}</span>
          <span v-show="list.validity_at">有效期至{{ list.validity_at }}</span>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import integral_get_record_controller from "./integral_get_record_controller";

export default integral_get_record_controller;
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#get_record {
  .listTxt {
    padding: 2rem 0;
  }
  @keyframes ident {
    0% {
      opacity: 0;
    }

    50% {
      opacity: 0.75;
    }

    100% {
      opacity: 1;
    }
  }
  .showPosBox {
    animation: ident 0.5s;
  }
  .background_box {
    color: #382c0a;
    background-color: #fff;
    background-image: -webkit-gradient(linear, left top, left bottom, from(var(--themeBaseColor)), to(#f5f5f5));
    background-image: -webkit-linear-gradient(var(--themeBaseColor), #f5f5f5);
    background-image: linear-gradient(var(--themeBaseColor), #f5f5f5);
    min-height: 9.25rem;
    padding: 1.5938rem 1.0938rem 0 1.0938rem;
  }

  .statusBox {
    margin: 0 0.625rem;
    margin-top: -7rem;
    margin-bottom: 0.625rem;
    display: flex;
    justify-content: space-between;
    z-index: 1;
    position: relative;
    .statusBox_left {
      display: flex;
      font-size: 0.75rem;
      color: #262626;
      .txt {
        line-height: 1.875rem;
        width: 3.75rem;
      }
      .showtxt {
        width: 3.75rem;
        height: 1.875rem;
        background: #ffffff;
        border-radius: 0.9375rem;
      }
    }
    .statusBox_right {
      min-width: 5.3125rem;
      height: 1.875rem;
      background: #fdefbd;
      border-radius: 0.3125rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 0.4688rem;
      position: relative;
      .txt {
        flex: 1;
        text-align: center;
      }
      .statusBox_right_pos {
        background: #fdefbd;
        position: absolute;
        bottom: -4.3rem;
        left: 0;
        width: 100%;
        z-index: 22222222;
        border-radius: 0 0 0.3125rem 0.3125rem;
        .postxt {
          height: 1.5rem;
          line-height: 1.5rem;
        }
      }
    }
  }
  .list {
    margin: 0 0.625rem;
    padding: 0 0.875rem;
    margin-top: 0.9375rem;
    background: #ffffff;
    border-radius: 0.625rem;
    margin-bottom: 0.625rem;
    .lis:first-child {
      border: none;
    }
    .lis {
      display: flex;
      flex-direction: column;
      padding: 0.9375rem 0;
      border-bottom: 1px solid #f6f6f6;
      .dob {
        margin-top: 0.4688rem;
      }
      .lisTop {
        display: flex;
        justify-content: space-between;
        align-items: center;
        .txtName {
          font-size: 14px;
        }
        .price {
          font-size: 14px;
          font-weight: 500;
          color: #f20606;
        }
        .time {
          font-size: 0.6875rem;
          color: #999999;
        }
        .balance {
          font-size: 0.6875rem;
          font-weight: 400;
          color: #666666;
        }
      }
    }
  }
  .timeSelect {
    margin-top: -5rem;
  }
  .timeSelect {
    height: 2.5rem;
    background: #ffffff;
    border-radius: 0.625rem;
    margin: 0 0.625rem;
    display: flex;
    padding: 0 0.9063rem;
    align-items: center;
    position: sticky;
    top: 40px;
    .timeBox {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      .time {
        margin-right: 0.5rem;
        font-size: 0.8125rem;
      }
    }
    .totalNum {
      flex: 1;
      text-align: right;
      font-size: 14px;
      color: #333333;
    }
  }
}
</style>